#include <iostream>
#include <fstream>
#include <string>
#include <unordered_map>
using namespace std;

const string filename = "./text.txt";

class dict {
public:
    dict() {
        ifstream infile(filename);
        if(!infile.is_open()) {
            cerr << "Error opening file" << endl;
            return;
        }
        string s;
        while(getline(infile, s)) {
            spilt(s);
        }
        dict_map["Unknown"] = "Unknown";
    }

    string& translate(const string &s) {
        if(dict_map.count(s) == 0) {
            return dict_map["Unknown"];
        }
        return dict_map[s];
    }
private:
    void spilt(const string &s) {
        auto pos = s.find(':');
        if(pos != string::npos) {
            dict_map[s.substr(0, pos)] = s.substr(pos + 1);
        }
    }
    unordered_map<string, string> dict_map;
};